
#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include <stdexcept>
#include <Volume.h>
#include <Length.h>
#include <Unit.h>


USING_MOCKCPP_NS
USING_TESTNGPP_NS

FIXTURE(Volume)
{
    TEST(should be able check equation of 1 OZ and 3 TBS)
    {
        ASSERT_EQ(Volume(1, OZ), Volume(3, TBS));
    }

    TEST(should be able to check equation of 1 TBS and 16 TSP)
    {
        ASSERT_EQ(Volume(1, TBS), Volume(16, TSP));
    }
    TEST(should be able to check equation of 1 OZ and 48 TSP)
    {
        ASSERT_EQ(Volume(1, OZ), Volume(48, TSP));
    }

    TEST(should be able check equation of 1 OZ + 3 TBS = 6 TBS)
    {
        ASSERT_EQ(Volume(1, OZ)+Volume(3, TBS), Volume(6, TBS));
    }
    
    TEST(should be able check equation of 1 OZ + 3 TBS = 2 OZ)
    {
        ASSERT_EQ(Volume(1, OZ)+Volume(3, TBS), Volume(2, OZ));
    }

    TEST(should be able to check equation of 2 TBS + 16 TSP = 3 TBS)
    {
        ASSERT_EQ(Volume(2, TBS)+Volume(16, TSP), Volume(3, TBS));
    }

    TEST(should be able to check equation of 1 OZ + 48 TSP = 96 TSP)
    {
        ASSERT_EQ(Volume(1, OZ) + Volume(48, TSP), Volume(96, TSP));
    }

    TEST(Volume 1 TBS and Length 1 YARD can not be compare togther)
    {
        ASSERT_THROWS((Volume(1, TBS)==Length(1, YARD)), std::invalid_argument);
    } 

    TEST(Volume 1 TSP and Length 1 FEET can not be compare togther)
    {
        ASSERT_THROWS((Volume(1, TSP)!=Length(1, FEET)), std::invalid_argument);
    } 

    TEST(Volume 1 OZ and Length 1 MILE can not be add togther)
    {
        ASSERT_THROWS((Volume(1, OZ)+Length(1, MILE)), std::invalid_argument);
    } 

};
FIXTURE(VolumeUnit Printing)
{
    TEST(Print 4 TBS to 1 OZ and 1 TBS)
    {
      string outstring("1 OZ 15 TBS");
    
      Volume  OZ4(4, OZ);
      ASSERT_EQ(OZ4.printUnitStepString(), outstring); 
    }

    TEST(Print 0 TSP to 0 TSP)
    {
      string outstring("0 TSP");
    
      Volume  TSP0(0, TSP);
      ASSERT_EQ(TSP0.printUnitStepString(), outstring); 
    }

    TEST(Print 65 TSP to 1 OZ and 1 TBS and 1 TSP)
    {
      string outstring("1 OZ 1 TBS 2 TSP");
      Volume  TSP65(65, TSP);
      ASSERT_EQ(TSP65.printUnitStepString(), outstring); 
    }

    TEST(Print 1 OZ to 48 TSP)
    {
      string outstring("48 TSP");
      Volume  OZ1(48, TSP);
      ASSERT_EQ(OZ1.printUnitStepString(), outstring); 
    }

};
